export {};

let fn = (value: string, index: number, array: string[]): number => {
  console.log(value, index, array);
  return 123;
};

const fn1 = (): number => {
  console.log('空空');
  return 1;
};
const fn2 = (a: string): void => {
  console.log(a);
};
const fn3 = (a: string, b: number): void => {
  console.log(a, b);
};
const fn4 = (a: string, b: number, c: string[]): void => {
  console.log(a, b, c);
};
const fn5 = (a: string, b: number, c: string[], d: number): void => {
  console.log(a, b, c, d);
};

fn = fn1; // 没问题
// fn('a', 1, ['b']); // 输出？
// console.log(fn.toString());
// fn = fn2;
// fn = fn3;
// fn = fn4;
// fn = fn5

// 实际案例
const arr = ['a', 'b', 'c'];
arr.forEach(() => console.log('11'));
arr.forEach((item) => console.log(item));
arr.forEach((item, index) => console.log(item, index));
arr.forEach((item, index, arr) => console.log(item, index, arr));
// arr.forEach((item, index, arr, type) => console.log(item, index, arr));
